home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / C++ AppleLink Messages / CPlus.Dev$ 4⁄27⁄90 / 0109-Re Copy Cconstructor-Apr90 < prev    next >
Encoding:
Text File  |  1990-04-27  |  895 b   |  25 lines  |  [TEXT/GEOL]

  1. Item    9747867                         23-April-90        17:40PDT
  2.  
  3. From:   MIKE.VILOT                      ObjectWare, Michael Vilot,PRT
  4.  
  5. To:     DEREK                           White, Derek
  6.  
  7. cc:     CPLUS.APPLE$                    C++ Interest List--Apple Employees
  8.         CPLUS.DEV$                      C++ Interest List--Developers
  9.  
  10. Sub:    Re: Copy Cconstructors & op=
  11.  
  12. Copying and assigning are indeed similar.  In cases where the default
  13. member-wise semantics aren't sufficient, but copying and assigning are
  14. semantically the same, then it may indeed be simpler to implement one in terms
  15. of the other.
  16.  
  17. The main distinction is that a constructor is building a _new_ object, while
  18. operator= is overwriting an _existing_ object.  There may be cases (reference
  19. counting springs to mind) where the details of these two operations are in fact
  20. different.
  21.  
  22. Hope this helps,
  23.     Mike
  24.  
  25.